package com.ucar.train.vo;

import com.ucar.train.utils.JodaUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * t_b_car
 * @author 
 */
public class CarVO implements Serializable {
    /**
     * 主键
     */
    private Long id;

    /**
     * 车编号
     */
    private String carId;

    /**
     * 车牌号
     */
    private String carNum;

    /**
     * 车类型
     */
    private String type;

    /**
     * 状态，1在组，2闲置，3故障
     */
    private Integer state;
    private String stateStr;

    /**
     * 状态，1在组，2闲置，3故障
     */
    private BigDecimal cost;

    public BigDecimal getCost() {
        return cost;
    }

    public void setCost(BigDecimal cost) {
        this.cost = cost;
    }

    public String getStateStr() {
        if (state==0){
          stateStr="在组";
        }
        if (state==1){
            stateStr="闲置";
        }
        if (state==2){
            stateStr="故障";
        }
        return stateStr;
    }

    public void setStateStr(String stateStr) {
        this.stateStr = stateStr;
    }

    /**
     * 保修时间
     */
    private Date maintenanceTime;

    /**
     * 保修时间
     */
    private String maintenanceTimeStr;

    public String getMaintenanceTimeStr() {

        if(maintenanceTime!=null){
            maintenanceTimeStr= JodaUtils.dateToString(maintenanceTime,"yyyy-MM-dd HH:mm:ss");
        }
        return maintenanceTimeStr;
    }

    public void setMaintenanceTimeStr(String maintenanceTimeStr) {

        this.maintenanceTimeStr = maintenanceTimeStr;
    }

    /*
    * 门店名称
    */
    private String storeName;

    private String storeId;

    public List<String> getComment() {
        return comment;
    }

    public void setComment(List<String> comment) {
        this.comment = comment;
    }

    /*
     * 车评论
     * */
    private List<String> comment;


    public String getStoreId() {
        return storeId;
    }

    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }

    public String getStoreName() {
        return storeName;
    }

    public void setStoreName(String storeName) {
        this.storeName = storeName;
    }

    private static final long serialVersionUID = 1L;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCarId() {
        return carId;
    }

    public void setCarId(String carId) {
        this.carId = carId;
    }

    public String getCarNum() {
        return carNum;
    }

    public void setCarNum(String carNum) {
        this.carNum = carNum;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Date getMaintenanceTime() {
        return maintenanceTime;
    }

    public void setMaintenanceTime(Date maintenanceTime) {
        this.maintenanceTime = maintenanceTime;
    }


    @Override
    public String toString() {
        return "CarVO{" +
                "id=" + id +
                ", carId='" + carId + '\'' +
                ", carNum='" + carNum + '\'' +
                ", type='" + type + '\'' +
                ", state=" + state +
                ", stateStr='" + stateStr + '\'' +
                ", cost=" + cost +
                ", maintenanceTime=" + maintenanceTime +
                ", maintenanceTimeStr='" + maintenanceTimeStr + '\'' +
                ", storeName='" + storeName + '\'' +
                ", storeId='" + storeId + '\'' +
                '}';
    }
}